package io.gitee.hefren.hhmq.client;

import io.gitee.hefren.hhmq.model.HhMessage;

import static com.google.common.base.Preconditions.*;

import java.util.Objects;

/**
 * 消息的生产者
 * @Date 2024/7/21
 * @Author lifei
 */
public class HhProducer {

    private HhBroker hhBroker;

    public HhProducer(HhBroker hhBroker) {
        this.hhBroker = hhBroker;
    }

    /**
     * 发送一条消息到 消息队列
     * @param topic
     * @param hhMessage
     * @return
     */
    public boolean send(String topic, HhMessage<?> hhMessage) {
        return hhBroker.send(topic, hhMessage);
    }

}
